When reffing the display fails in init, we were still trying to unref
it. Which obviously failed and spewed warnings to stderr.
#endif
guint32 draw_index;
+
+ guint vulkan_ref: 1;
};
enum {
/* display will be unset in gdk_draw_context_dispose() */
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
- if (display)
+ if (display && priv->vulkan_ref)
gdk_display_unref_vulkan (display);
G_OBJECT_CLASS (gdk_vulkan_context_parent_class)->dispose (gobject);
VkBool32 supported;
uint32_t i;
- if (!gdk_display_ref_vulkan (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), error))
+ priv->vulkan_ref = gdk_display_ref_vulkan (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), error);
+ if (!priv->vulkan_ref)
return FALSE;
res = GDK_VULKAN_CONTEXT_GET_CLASS (context)->create_surface (context, &priv->surface);